﻿/*
 * Copyright (c) 2000-2015 Tacke Consulting, Inc
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
 * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 
 * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions 
 * of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 
 * TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
 * DEALINGS IN THE SOFTWARE.
 * 
 */
using System;

using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

namespace OpenNETCF.Media.DirectShow
{
    /// <summary>
    /// The AmMediaType structure is the primary structure used to describe media formats 
    /// for the objects of the Windows Media Format SDK.
    /// </summary>
    [StructLayout(LayoutKind.Sequential)]
    internal class AmMediaType
    {
        /// <summary>Major type of the media sample. For example, WMMEDIATYPE_Video specifies a video stream.</summary>
        public Guid majortype;
        /// <summary>Subtype of the media sample. The subtype defines a specific format (usually an encoding scheme) within a major media type.</summary>
        public Guid subtype;
        /// <summary>
        /// Set to true if the samples are of a fixed size. Compressed audio samples are of a fixed size while video samples are not.
        /// </summary>
        [MarshalAs(UnmanagedType.Bool)]
        public bool bFixedSizeSamples;
        /// <summary>
        /// Set to true if the samples are temporally compressed. Temporal compression is compression where some 
        /// samples describe the changes in content from the previous sample, instead of describing the sample in its entirety.
        /// </summary>
        [MarshalAs(UnmanagedType.Bool)]
        public bool bTemporalCompression;
        /// <summary>Long integer containing the size of the sample, in bytes.</summary>
        public uint lSampleSize;
        /// <summary>GUID of the format type.</summary>
        public Guid formattype;
        /// <summary>Not used. Should be NULL.</summary>
        public IntPtr pUnk;
        /// <summary>Size, in bytes, of the structure pointed to by pbFormat.</summary>
        public uint cbFormat;
        /// <summary>Pointer to the format structure of the media type.</summary>
        public IntPtr pbFormat;
    };
}
